<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>inset</title>
    <!-- inset 是 top、right、bottom、left 的简写属性，可以同时设置四个方向的偏移量。 -->
    <style>
        .outer {
            width: 400px;
            height: 400px;
            background-color: pink;
            position: relative;
        }

        .inner {
            width: 200px;
            height: 200px;
            background-color: skyblue;
            position: absolute;
            /* left: 0;
            top: 0;
            right: 0;
            bottom: 0; */
            inset: 0;
            /* inset: 0; 等同于 top: 10px; right: 20px; bottom: 10px; left: 20px; */
            margin: auto;
        }
    </style>
</head>

<body>
    <p>inset可以同时设置四个方向的偏移量。</p>
    <div class="outer">
        <div class="inner"></div>
    </div>
</body>

</html>